#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QGraphicsScene>
#include <QGraphicsView>
#include <QGraphicsItem>
#include <QMouseEvent>
#include <QDebug>
#include <string>

#include <container.h>

namespace Ui {
    class Widget;
}

class Widget : public QWidget
{
    Q_OBJECT

public:
    explicit Widget(QWidget *parent = 0);
    ~Widget();

private slots:
    void onSavebuttonClicked();
    void onLoadbuttonClicked();
    void onSquarebuttonClicked();
    void onCirclebuttonClicked();
    void onRectanglebuttonClicked();
    void onRotateToRightButtonClicked();
    void onRotateToLeftButtonClicked();

private:
    Ui::Widget *ui;
    QGraphicsScene *scene;
    std::string curFigure;
    Container c;
    bool addShapeToContainer = false;


    void drowCircle(const QPoint &pos, double rot);
    void drowSquare(const QPoint &pos, double rot);
    void drowRectangle(const QPoint &pos, double rot);
    void mousePressEvent(QMouseEvent* ev);
    void showAllShapes();
};

#endif // WIDGET_H
